package com.javaEEpro.statics;

import java.util.ArrayList;

/**
 * 斗地主，初始化一副牌
 */
public class staticTest {
    /**
     *创建一个静态字符集合
     */
    public static ArrayList<String> cards=new ArrayList<>();

    /**
     定义静态代码块对这副牌进行初始化
     */
    static {
        //1.将所有可能出现的牌点都列出来,存放在字符数组里面
        String []Num={"3","4","5","6","7","8","9","10","J","Q","K","A","2"};
        //2.将所有的花色都列出来
        String [] colors={"♠","♣","♦","♥"};
        //3.将牌点和花色组合
        for (int i = 0; i < Num.length; i++) {
            for (int j = 0; j < colors.length; j++) {
                String card=Num[i]+colors[j];
                cards.add(card);
            }
        }
        //4.加上大王和小王
        cards.add("小王");
        cards.add("大王");
    }

    public static void main(String[] args) {
        System.out.println(cards);
    }
}
